﻿<Window x:Class="SizeOnDisk.AboutBox"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ui="clr-namespace:SizeOnDisk.UI"
        Title="{Binding RelativeSource={RelativeSource Self}, Mode=OneTime, Path=ProductTitle}"
        Style="{DynamicResource AboutDialogStyle}"
        WindowStartupLocation="CenterOwner">
    <Window.Resources>
        <XmlDataProvider x:Key="aboutProvider"
                         XPath="ApplicationInfo"
                         IsAsynchronous="False"
                         IsInitialLoadEnabled="True">
            <x:XData>
                <ApplicationInfo xmlns="">
                    <Link Uri="http://sizeondisk.codeplex.com">More Info</Link>
                </ApplicationInfo>
            </x:XData>
        </XmlDataProvider>
        <Style x:Key="AboutDialogStyle"
               TargetType="Window">
            <Setter Property="Height"
                    Value="Auto" />
            <Setter Property="Width"
                    Value="500" />
            <Setter Property="ShowInTaskbar"
                    Value="False" />
            <Setter Property="ResizeMode"
                    Value="NoResize" />
            <Setter Property="WindowStyle"
                    Value="SingleBorderWindow" />
            <Setter Property="SizeToContent"
                    Value="Height" />
        </Style>
        <Style x:Key="DisplayAreaStyle"
               TargetType="{x:Type StackPanel}">
            <Setter Property="Margin"
                    Value="10,10,10,5" />
        </Style>
        <Style x:Key="BackgroundStyle"
               TargetType="{x:Type StackPanel}">
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0,1">
                        <GradientStop Offset="0"
                                      Color="LightBlue" />
                        <GradientStop Offset="0.55"
                                      Color="White" />
                        <GradientStop Offset="0.85"
                                      Color="White" />
                        <GradientStop Offset="1"
                                      Color="LightBlue" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="Label">
            <Setter Property="Padding"
                    Value="0" />
        </Style>
        <Style x:Key="ParagraphSeparator"
               TargetType="{x:Type Label}">
            <Setter Property="Padding"
                    Value="0,10,0,0" />
        </Style>
        <Style x:Key="LinkLabelStyle">
            <Setter Property="Control.Padding"
                    Value="0" />
            <Setter Property="Control.VerticalAlignment"
                    Value="Center" />
        </Style>
        <Style x:Key="ReadOnlyDescStyle"
               TargetType="{x:Type TextBox}">
            <Setter Property="MinLines"
                    Value="6" />
            <Setter Property="MaxLines"
                    Value="6" />
            <Setter Property="IsReadOnly"
                    Value="True" />
            <Setter Property="TextWrapping"
                    Value="WrapWithOverflow" />
            <Setter Property="VerticalScrollBarVisibility"
                    Value="Visible" />
        </Style>
        <Style x:Key="OkButtonStyle"
               TargetType="{x:Type Button}">
            <Setter Property="MinWidth"
                    Value="75" />
            <Setter Property="Margin"
                    Value="0,5" />
            <Setter Property="DockPanel.Dock"
                    Value="Right" />
            <Setter Property="IsDefault"
                    Value="True" />
            <Setter Property="IsCancel"
                    Value="True" />
        </Style>
    </Window.Resources>
    <StackPanel Style="{StaticResource BackgroundStyle}"
                DataContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Mode=OneTime}">
        <Grid Background="#FF7092BE"
              Height="75">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Image Margin="10,0"
                   Source="Icons/Hard_Drive_64x64.png"
                   Width="64"
                   Height="64" />
            <TextBlock Grid.Column="1"
                       Text="{Binding Mode=OneTime, Path=Product}"
                       Foreground="White"
                       VerticalAlignment="Center"
                       FontSize="24" />
        </Grid>
        <StackPanel Style="{StaticResource DisplayAreaStyle}">
            <StackPanel Orientation="Horizontal">
                <Label Content="Version" />
                <Label Content=" - " />
                <Label Content="{Binding Mode=OneTime, Path=Version}" />
            </StackPanel>
            <Label Content="{Binding Mode=OneTime, Path=Copyright}" />
            <Label Content="{Binding Mode=OneTime, Path=Company}" />
            <Label Content="All Rights Reserved." />
            <TextBox Text="{Binding Mode=OneTime, Path=Description}"
                     Style="{StaticResource ReadOnlyDescStyle}" />
            <DockPanel>
                <Button Style="{StaticResource OkButtonStyle}"
                        Content="OK" />
                <Label Style="{StaticResource LinkLabelStyle}">
                    <Hyperlink NavigateUri="{Binding Mode=OneTime, Path=LinkUri}"
                               Style="{StaticResource LinkLabelStyle}"
                               Hyperlink.RequestNavigate="hyperlink_RequestNavigate">
                        <TextBlock Text="{Binding Mode=OneTime, Path=LinkText}" />
                    </Hyperlink>
                </Label>
            </DockPanel>
        </StackPanel>
    </StackPanel>
</Window>